package main

import (
	"com.codingq92/go-chat/bootstrap"
	"com.codingq92/go-chat/global"
)

func main() {
	//初始化配置文件
	bootstrap.InitConfig()
	//初始化日志
	bootstrap.InitLog()
	//初始化redis
	bootstrap.InitRedis()
	//初始化数据库
	bootstrap.InitDB()
	defer func() {
		if nil != global.DB {
			db, _ := global.DB.DB()
			_ = db.Close()
		}
		global.Log.Info("server shutdown")
	}()
	//启动http服务
	bootstrap.RunServer()
}
